package com.xnyzc.lhy.common.penum.wallet;

public enum EIsTransaction {

    pay(0, "支付中"),
    paySuccess(1, "支付成功"),
    payFailed(2, "支付失败");

    private Integer value;
    private String desc;

    EIsTransaction(Integer value, String desc){
        this.value = value;
        this.desc = desc;
    }

    public static EIsTransaction findById(Integer type){
        EIsTransaction eIsTransaction;
        switch (type){
            case 0:
                eIsTransaction  = EIsTransaction.pay;
                break;
            case 1:
                eIsTransaction = EIsTransaction.paySuccess;
                break;
            case 2:
                eIsTransaction = EIsTransaction.payFailed;
                break;
            default:
                throw new IllegalArgumentException("非法type");
        }
        return eIsTransaction;
    }

    public Integer getValue() {
        return this.value;
    }

    public String getDesc() {
        return this.desc;
    }
}
